package com.jiang.daily.Q2154;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/11/19 15:27
 */
public class Solution {
    public int findFinalValue(int[] nums, int original) {
        Set<Integer> set = new HashSet<>();
        for (int num : nums) {
            set.add(num);
        }

        while (set.contains(original)) {
            original *= 2;
        }

        return original;
    }
}
